<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateTasksTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('tasks', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('title')->index('title');
			$table->string('content', 8192);
			$table->string('answer');
			$table->string('material', 5000);
			$table->integer('solvecnt')->default(0);
			$table->integer('trycnt')->default(0);
			$table->integer('learncnt')->default(0);
			$table->timestamps();
			$table->string('author');
			$table->integer('x')->default(0);
			$table->integer('y')->default(0);
			$table->integer('contributor')->default(0);
			$table->string('study', 5000);
			$table->integer('score')->default(0);
		});
        DB::update('ALTER TABLE tasks AUTO_INCREMENT = 156');
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('tasks');
	}

}
